NFC Configuration Method, NFC Data Transmission Method, Controller, and NFC Controller

ABSTRACT

An NFC configuration method. A controller sends data and a parameter of the data to an NFC module for storage or sends a storage space application instruction to an NFC module, such that storage space is reserved for data in the NFC module. Therefore, when data is sent or received in an NFC High manner, the sent data can be acquired from the NFC module or the received data can be stored in the NFC module without participation of a DH, thereby reducing load of the DH.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of International Application No.PCT/CN2013/071029, filed on Jan. 28, 2013, which is hereby incorporatedby reference in its entirety.

TECHNICAL FIELD

The present invention relates to the communications field, and inparticular, to a near field communication (NFC) configuration method, anNFC data transmission method, a controller, and an NFC controller.

BACKGROUND

NFC is a technology in which magnetic field induction is used toimplement short-distance communication between electronic devices. Apeer to peer (P2P) mode is a bidirectional communication mode in the NFCcommunication. Two NFC terminals can perform bidirectional informationexchange in the P2P mode. In the P2P mode, generally the Logical LinkControl Protocol (LLCP) is used to establish a data link and performoperations, such as activation, deactivation, and management.

With the development of the NFC technology, an NFC High technologyemerges. A characteristic of the NFC High technology is that an NFCcontroller (NFCC) controls a related operation that is based on an LLCPlink, and a controller (also known as a Device Host or a DH) of anelectronic device serves as a master controller and is responsible forapplication-layer data exchange over an LLCP link. In this case, as longas the NFC High technology is used to transmit application-layer data,the DH is required to stay in an operating state. Therefore, the DH isrequired to participate in NFC P2P data transmission involvingapplication-layer data, which increases load of the DH.

SUMMARY

In view of this, embodiments of the present invention provide an NFCconfiguration method, an NFC data transmission method, a controller, andan NFC controller, which are intended to resolve a problem that in theexisting NFC High technology, NFC P2P data transmission involvingapplication-layer data increases load of a DH.

To achieve the foregoing objective, the embodiments of the presentinvention provide the following technical solutions.

A first aspect of an embodiment of the present invention provides an NFCconfiguration method that is applied to a controller of an electronicdevice, where after the controller of the electronic device configuresan LLCP link parameter, the method includes at least one of thefollowing: sending preset data and a parameter of the data to an NFCmodule of the electronic device so that the NFC module stores the dataand the parameter of the data; or sending a storage space applicationinstruction to an NFC module so that the NFC module determines storagespace for received data according to the instruction.

A second aspect of an embodiment of the present invention providesanother NFC configuration method that is applied to an NFC module of anelectronic device, wherein the method includes at least one of thefollowing: receiving and storing preset data and a parameter of thedata, where the preset data and the parameter of the data are sent by acontroller of the electronic device after an LLCP link parameter isconfigured; or receiving a storage space application instruction anddetermining storage space for received data according to theinstruction, where the storage space application instruction is sent bya controller of the electronic device after an LLCP link parameter isconfigured.

A third aspect of an embodiment of the present invention provides an NFCdata transmission method that is applied to an NFC controller in an NFCmodule of an electronic device, wherein the method includes: after anNFC link is established, acquiring data from the NFC module according toa type of the NFC link and a parameter of the data, and sending the datausing the NFC link, where the data and the parameter of the data aresent to the NFC module of the electronic device by a controller of theelectronic device after an LLCP link parameter is configured, and thedata and the parameter of the data are stored by the NFC module; orafter an NFC link is established, receiving, according to a type of theNFC link, data sent by a peer device and storing the data in presetstorage space in the NFC module, where the preset storage space isdetermined by the NFC controller according to a received storage spaceapplication instruction that is sent by a controller of the electronicdevice after an LLCP link parameter is configured.

A fourth aspect of an embodiment of the present invention provides acontrol apparatus that is applied to an electronic device, wherein theapparatus includes an NFC configuring module configured to, after acontroller of the electronic device configures an LLCP link parameter,send preset data and a parameter of the data to an NFC module of theelectronic device so that the NFC module stores the data and theparameter of the data; and/or after the controller of the electronicdevice configures the LLCP link parameter, send a storage spaceapplication instruction to the NFC module so that the NFC moduledetermines storage space for received data according to the instruction.

A fifth aspect of an embodiment of the present invention provides an NFCapparatus that is applied to an electronic device, wherein the apparatusincludes a configuration response module configured to receive and storepreset data and a parameter of the data, where the preset data and theparameter of the data are sent by a controller of the electronic deviceafter an LLCP link parameter is configured; and/or receive a storagespace application instruction and determine storage space for receiveddata according to the instruction, where the storage space applicationinstruction is sent by the controller of the electronic device after theLLCP link parameter is configured.

A sixth aspect of an embodiment of the present invention provides an NFCcontrol apparatus that is applied to an NFC module of an electronicdevice, wherein the apparatus includes at least one of an NFC datasending module configured to, after an NFC link is established, acquiredata from the NFC module according to a type of the NFC link and aparameter of the data and send the data using the NFC link, where thedata and the parameter of the data are sent to the NFC module of theelectronic device by a controller of the electronic device after an LLCPlink parameter is configured, and the data and the parameter of the dataare stored by the NFC module; and an NFC data receiving moduleconfigured to, after the NFC link is established, receive, according tothe type of the NFC link, data sent by a peer device and store the datain preset storage space in the NFC module, where the preset storagespace is determined by the NFC controller according to a receivedstorage space application instruction that is sent by the controller ofthe electronic device after the LLCP link parameter is configured.

The embodiments of the present invention provide an NFC configurationmethod. A controller sends data and a parameter of the data to an NFCmodule for storage or sends a storage space application instruction toan NFC module so that storage space is reserved for data in the NFCmodule. Therefore, when data is sent or received in an NFC High manner,the sent data can be acquired from the NFC module or the received datacan be stored in the NFC module without participation of a DH, therebyreducing load of the DH.

BRIEF DESCRIPTION OF DRAWINGS

To describe the technical solutions in the embodiments of the presentinvention more clearly, the following briefly introduces theaccompanying drawings required for describing the embodiments. Theaccompanying drawings in the following description show merely someembodiments of the present invention, and a person of ordinary skill inthe art may still derive other drawings from these accompanying drawingswithout creative efforts.

FIG. 1 is a flowchart of an NFC configuration method disclosed by anembodiment of the present invention;

FIG. 2 is a flowchart of an implementation manner in which a controllerDH sends preset data and a parameter of the data to an NFC module of anelectronic device in the NFC configuration method disclosed by anembodiment of the present invention;

FIG. 3 is a flowchart of another implementation manner in which acontroller DH sends preset data and a parameter of the data to an NFCmodule of an electronic device in the NFC configuration method disclosedby an embodiment of the present invention;

FIG. 4 is a flowchart of an implementation manner of sending a storagespace application instruction to an NFC module in the NFC configurationmethod disclosed by an embodiment of the present invention;

FIG. 5 is a flowchart of another implementation manner of sending astorage space application instruction to an NFC module in the NFCconfiguration method disclosed by an embodiment of the presentinvention;

FIG. 6 is a flowchart of another NFC configuration method disclosed byan embodiment of the present invention;

FIG. 7 is a flowchart of an implementation manner in which an NFC modulereceives and stores preset data and a parameter of the data in theanother NFC configuration method disclosed by an embodiment of thepresent invention;

FIG. 8 is a flowchart of another implementation manner in which an NFCmodule receives and stores preset data and a parameter of the data inthe another NFC configuration method disclosed by an embodiment of thepresent invention;

FIG. 9 is a flowchart of an implementation manner in which an NFC modulereceives a storage space application instruction, and determines storagespace according to the instruction in the another NFC configurationmethod disclosed by an embodiment of the present invention;

FIG. 10 is a flowchart of another implementation manner in which an NFCmodule receives a storage space application instruction, and determinesstorage space according to the instruction in the another NFCconfiguration method disclosed by an embodiment of the presentinvention;

FIG. 11 is a flowchart of an NFC data transmission method disclosed byan embodiment of the present invention;

FIG. 12 is a flowchart of a data sending method in the NFC datatransmission method disclosed by an embodiment of the present invention;

FIG. 13 is a flowchart of a data receiving method in the NFC datatransmission method disclosed by an embodiment of the present invention;

FIG. 14 is a schematic structural diagram of a controller disclosed byan embodiment of the present invention;

FIG. 15 is a schematic structural diagram of an NFC control apparatusdisclosed by an embodiment of the present invention; and

FIG. 16 is a schematic structural diagram of an NFC controller disclosedby an embodiment of the present invention.

DESCRIPTION OF EMBODIMENTS

Embodiments of the present invention disclose an NFC configurationmethod and a controller, where the core invention is that a controllerof an electronic device sends, to an NFC module, data that is sent in anNFC high manner and sends a storage space application instruction to theNFC module so as to reserve storage space for received data in the NFCmodule. Based on the foregoing configuration method and controller,embodiments of the present invention disclose an NFC data transmissionmethod and an NFC controller. When an electronic device transmits datausing NFC high, the NFC controller may directly acquire the sent datafrom an NFC module or store the received data in reserved storage spacein an NFC module. Therefore, participation of a controller of theelectronic device is not required when data is transmitted using the NFChigh.

The following clearly describes the technical solutions in theembodiments of the present invention with reference to the accompanyingdrawings in the embodiments of the present invention. The describedembodiments are merely some but not all of the embodiments of thepresent invention. All other embodiments obtained by a person ofordinary skill in the art based on the embodiments of the presentinvention without creative efforts shall fall within the protectionscope of the present invention.

An NFC configuration method disclosed by an embodiment of the presentinvention is applied to a controller of an electronic device. After thecontroller of the electronic device configures an LLCP link parameter,as shown in FIG. 1, the method includes at least one of the followingsteps.

S101. Send preset data and a parameter of the data to an NFC module ofthe electronic device.

The step is intended to enable the NFC module to store the data and theparameter of the data.

In this embodiment, the preset data is application-layer data preset bya user. An implementation procedure of sending preset data and aparameter of the data to an NFC module of the electronic device may besending the preset data and the parameter of the data to the NFC moduleof the electronic device after a data transfer instruction input by theuser is received or sending the preset data and the parameter of thedata to the NFC module of the electronic device when an electricquantity of the electronic device is lower than a preset value orsending the preset data and the parameter of the data to the NFC moduleof the electronic device when a data transfer instruction input by theuser is received and an electric quantity of the electronic device islower than a preset value.

It should be noted that the application-layer data may be a data set ora set (such as a Java Applet) of instructions and data.

The data transfer instruction input by the user may include transferdata preset by the user. For example, before a user goes out, the userdetermines a telephone number of an emergency contact as transfer data.The preset value may be a value that is set according to a totalelectric quantity of the electronic device. For example, the presetvalue is 10% of the total electric quantity of the electronic device.

In this embodiment, as shown in FIG. 2, an implementation manner inwhich the controller DH of the electronic device configures an LLCP linkparameter and sends preset data and a parameter of the data to the NFCmodule of the electronic device includes the following steps.

S201. The DH configures a parameter related to LLCP High.

The configuration procedure in this embodiment is the same as that inthe prior art and is used to configure a parameter related to LLCP linkestablishment.

S202. The DH sends the preset data to an NFCC in the NFC module of theelectronic device so that the NFCC sends the data to a storage unit inthe NFC module for storage.

S203. The DH sends the parameter of the preset data to the NFCC so thatthe NFCC stores the parameter of the data.

In this embodiment, the storage unit in the NFC module may be a securityelement (SE) in the NFC module. Generally, the SE is a module that isconfigured to store NFC user data and a running environment. The storageunit in the NFC module may also be a storage unit in the NFCC, that is,the NFCC has a storage function.

That is, in this implementation manner, the DH sends both the presetdata and the parameter of the data to the NFCC, and the NFCC stores thedata in the NFCC or stores the data in the SE in the NFC module andstores the parameter of the data in the NFCC.

The procedure in which the NFCC stores the data in the storage unit inthe NFC module is described in the following embodiments, and detailsare not described herein again.

In addition, as shown in FIG. 3, another implementation manner in whichthe controller DH of the electronic device configures an LLCP linkparameter and sends preset data and a parameter of the data to the NFCmodule of the electronic device includes the following steps.

S301. The DH configures a parameter related to LLCP High.

S302. The DH sends the preset data to a storage unit in the NFC module.

Similar to the foregoing implementation manner, the storage unit in theNFC module may be an SE or a storage unit in an NFCC.

After receiving the data, the storage unit stores the data and feedsback a storage address of the data to the DH.

S303. The DH receives a storage address fed back by the storage unit.

S304. The DH sends the storage address, an identifier of the storageunit, and the parameter of the data to an NFCC so that the NFCC storesthe identifier of the storage unit, the storage address, and theparameter of the data.

In this embodiment manner, the DH directly sends the preset data to theSE or the storage unit in the NFCC, and after receiving feedback fromthe SE or the storage unit in the NFCC, sends feedback information andthe parameter of the data to the NFCC.

In this embodiment, the parameter of the preset data includes at least aservice access point (SAP), and besides, may further preferably includea link service class (LSC), and the like.

In the foregoing two implementation manners, the SAP may be a contact, aShort Message Service (SMS) message, a photo, a coupon, or the like. TheLSC may be connection-oriented (CO), connectionless (CL), orconnection-oriented and connectionless (CO/CL).

Returning to FIG. 1, S102. Send a storage space application instructionto the NFC module so that the NFC module determines storage spaceaccording to the instruction.

Sending a storage space application instruction to the NFC module mayinclude sending the storage space application instruction to the NFCmodule after a data transfer instruction input by a user is received; orsending the storage space application instruction to the NFC module whenan electric quantity of the electronic device is lower than a presetvalue; or sending the storage space application instruction to the NFCmodule when a data transfer instruction input by a user is received andan electric quantity of the electronic device is lower than a presetvalue.

As shown in FIG. 4, an implementation manner in which the DH configuresan LLCP link parameter and sends a storage space application instructionto the NFC module includes the following steps.

S401. The DH configures a parameter related to LLCP High.

S402. The DH sends the storage space application instruction to an NFCCin the NFC module.

The storage space instruction includes a storage space parameter, andthe storage space parameter includes at least a space capacity and anSAP, and besides, may further include an LSC.

After receiving the storage space application instruction, the NFCCapplies to a storage unit in the NFC module for storage space. A step inwhich the NFCC applies to the storage unit for the storage space isdescribed in the following embodiments.

The storage unit in the NFC module may be an SE or may be a storage unitin the NFCC. That is, the DH sends the instruction to request the NFCCto apply for the storage space. After receiving the storage spaceapplication instruction, the NFCC may apply to the SE for the storagespace or may apply to the storage unit of the NFCC for the storagespace.

As shown in FIG. 5, another implementation manner in which the DHconfigures an LLCP link parameter and sends a storage space applicationinstruction to the NFC module includes the following steps.

S501. The DH configures a parameter related to LLCP High.

S502. The DH sends the storage space application instruction thatincludes a space capacity to a storage unit in the NFC module. Likewise,the storage unit may be an SE or a storage unit in an NFCC.

After receiving the application instruction, the storage unit determinesstorage space corresponding to the application instruction, that is, acapacity of the determined storage space is the same as the spacecapacity included in the application instruction; and sends an addressof the determined storage space to the DH.

S503. The DH receives an address of determined storage space fed back bythe storage unit.

S504. Send an identifier of the storage unit, the address of the storagespace, and a storage space parameter to an NFCC in the NFC module.

After receiving the foregoing data, the NFCC stores the data.

The storage space parameter includes at least an SAP, and besides, mayfurther include an LSC.

According to the NFC configuration method in this embodiment,configuration is performed on an NFC module before NFC datatransmission. Compared with an existing NFC configuration method,according to the method in this embodiment, in addition to generalconfiguration performed on the NFC, a DH further stores preset data inthe NFC module, or applies to the NFC module for storage space, suchthat the NFC module implements some functions of the DH to a certaindegree. Therefore, at an NFC data transmission stage, functions of theDH for sending and storing application-layer data can be implemented bythe NFC module. Therefore, participation of the DH is not required. Whenthe DH cannot work for some reasons, the NFC module can still performdata transmission.

The method in the foregoing embodiment is mainly described from aperspective of a controller of an electronic device. An embodiment ofthe present invention discloses another NFC configuration method that isapplied to an NFC module of the electronic device. As shown in FIG. 6,the method includes at least one of the following steps.

S601. The NFC module receives and stores preset data and a parameter ofthe data.

The preset data and the parameter of the data are sent by a controllerof the electronic device after an LLCP link parameter is configured.

As shown in FIG. 7, one implementation manner in which the NFC modulereceives and stores preset data and a parameter of the data includes thefollowing steps.

S701. An NFCC receives the preset data and the parameter of the datathat are sent by a DH.

S702. The NFCC sends the data to a storage unit in the NFC module.

Preferably, the storage unit in the NFC module is an SE or a storageunit in the NFCC.

S703. The storage unit informs the NFCC that the storage succeeds andfeeds back a storage address of the data to the NFCC.

S704. The NFCC stores an identifier of the storage unit, the storageaddress, and the parameter of the data in a first preset manner.

S705. The NFCC informs the DH that the configuration succeeds.

Preferably, the NFCC may correspondingly store the identifier of thestorage unit, the storage address, and the parameter of the data in alist method, for example, in a form of Table 1.

SEID is an identifier of a storage unit, SE1, SE2, SE3, and SE4 arespecific storage units, and Addr1, Addr2, Addr3, and Addr4 are specificstorage addresses.

When the data is Java Applet, a Data parameter is an identifier of theJava Applet.

TABLE 1 SAP LSC SEID Data In/Out Contacts (contact) CO/CL (twoconnection types are supported) SE1 Addr1 Out SMS (SMS message) CO/CL(two connection types are supported) SE2 Addr2 Out Photo (photo) CO/CL(two connection types are supported) SE3 Addr3 Out Coupon (coupon) CO(only connection-oriented is supported) SE4 Addr4 Out

That is, after the NFCC receives the data and the parameter of the datathat are sent by the DH, and the NFCC exchanges with the storage unit inthe NFC module, it is implemented that the data and the parameter of thedata are stored.

As shown in FIG. 8, another implementation manner in which the NFCmodule receives and stores preset data and a parameter of the dataincludes the following steps.

S801. A storage unit in the NFC module receives the preset data.

S802. The storage unit stores the data, informs a DH that the storagesucceeds, and sends a storage address of the data to the DH.

S803. An NFCC receives an identifier of the storage unit, the storageaddress, and the parameter of the data that are sent by the DH andstores the identifier of the storage unit, the storage address, and theparameter of the data in a first preset manner.

A specific storage manner may be shown in Table 1.

S804. The NFCC informs the DH that the configuration succeeds.

A difference from the previous implementation manner is that, in thisimplementation manner, the storage unit directly exchanges with the DH,and after the storage address is determined, the NFCC receives thestorage address, the identifier of the storage unit, and the parameterof the data that are sent by the DH.

Returning to FIG. 6, S602. Receive a storage space applicationinstruction and determine storage space according to the instruction,where the storage space application instruction is sent by a controllerof the electronic device after an LLCP link parameter is configured.

As shown in FIG. 9, an implementation manner in which the NFC modulereceives a storage space application instruction and determines storagespace according to the instruction includes the following steps.

S901. An NFCC in the NFC module receives the storage space applicationinstruction that includes a storage space parameter.

The storage space parameter includes a space capacity and an SAP, andpreferably, may further include an LSC.

S902. The NFCC sends, according to the storage space applicationinstruction, an application instruction that includes a space capacityto an SE or a storage unit in the NFCC.

The space capacity in this step may be obtained from the storage spaceparameter.

S903. The SE or the storage unit in the NFCC determines the storagespace corresponding to the application instruction and sends an addressof the determined storage space to the NFCC.

A capacity of the storage space is the same as the space capacityincluded in the application instruction.

S904. The NFCC stores the address of the storage space, an identifier ofthe storage unit, and the storage space parameter.

S905. The NFCC informs the DH that the configuration succeeds.

As shown in FIG. 10, another implementation manner in which the NFCmodule receives a storage space application instruction and determinesstorage space according to the instruction includes the following steps.

S1001. A storage unit in the NFC module receives the storage spaceapplication instruction that includes a space capacity.

The storage unit in the NFC module is preferably an SE or a storage unitin an NFCC.

S1002. The storage unit determines the storage space corresponding tothe application instruction.

S1003. The storage unit sends an address of the determined storage spaceto a DH.

After receiving the address of the storage space, the DH sends theaddress of the storage space, an identifier of the storage unit, and astorage space parameter to the NFCC.

S1004. The NFCC receives the address of the storage space, an identifierof the storage unit, and a storage space parameter, and stores theaddress of the storage space, the identifier of the storage unit, andthe storage space parameter in a second preset manner.

The second preset manner may be shown in Table 2. A difference fromTable 1 is that, in Table 2, SAP may further be any type, and In/Out isstorage rather than output.

TABLE 2 SAP LSC SEID Data In/Out Contacts (contact) CO/CL (twoconnection types are supported) SE1 Addr1 storage SMS (SMS message)CO/CL (two connection types are supported) SE2 Addr2 storage Photo(photo) CO/CL (two connection types are supported) SE3 Addr3 storage Anytype CL (only connectionless is supported) SE4 Addr4 storage

S1005. The NFCC informs the DH that the configuration succeeds.

The NFC configuration method in this embodiment is mainly describedusing an NFC module as an object. An NFCC and a storage unit in the NFCmodule cooperate to store data and a parameter of the data that are sentby a DH or reserve storage space applied for by a DH. Therefore, duringa subsequent NFC data transmission procedure, participation of the DH isno longer required, and NFC data transmission can be implemented out ofcontrol of the DH. As a result, when the DH cannot work, the NFC datatransmission is not affected.

Based on the foregoing NFC configuration method, an embodiment of thepresent invention discloses an NFC data transmission method that isapplied to an NFCC in an NFC module of an electronic device. As shown inFIG. 11, the method includes at least one of the following steps.

S1101. After an NFC link is established, acquire data from the NFCmodule according to a type of the NFC link and a parameter of the dataand send the data using the NFC link, where the data and the parameterof the data are sent to the NFC module of the electronic device by acontroller of the electronic device after an LLCP link parameter isconfigured, and the data and the parameter of the data are stored by theNFC module.

That is, before NFC data transmission, the data and the parameter of thedata are stored in the NFC module in advance by the DH. The procedure ofstoring the data and the parameter of the data in the NFC module is aconfiguration stage for the NFC data transmission. Reference may be madeto the embodiment of the foregoing NFC configuration method, and detailsare not described herein again.

As shown in FIG. 12, S1101 may include the following steps.

S1201. Establish the NFC link.

An NFC link establishment procedure in this embodiment is the same asthat in the prior art, and details are not described herein again.Generally, according to a service class, the NFC link may be classifiedinto a CL type, a CO type, and CL/CO.

S1202. The NFCC determines the type of the NFC link.

That is, whether the NFC link is CL, CO, or CL/CO is determined.

S1203. The NFCC queries the parameter of the data and determines astorage unit in which the corresponding data that supports the type ofthe link is located.

The parameter of the data is sent by the DH to the NFC module forstorage at a configuration stage. In this embodiment, an identifier of astorage unit in which data corresponding to a type of a current NFC linkis located and a storage address may be queried from the foregoingTable 1. When data is Java Applet, an identifier of a storage unit inwhich the Java Applet corresponding to a type of a current NFC link islocated and an identifier of the Java Applet may be queried from theforegoing Table 1.

When a type of the NFC link is CL or CL/CO, Table 1 is queried, and itis determined that a type of a link that data in storage addressescorresponding to SE1, SE2, and SE3 supports is the same as the type ofthe NFC link, that is, the type of the current link is supported. When atype of the NFC link is CO, Table 1 is queried, and when an identifierof a storage unit and a storage address are determined, an SAP type isfurther used as a basis, in addition to a basis that LSC is CO, wherethe SAP type that is used as a basis is sent by a peer device at an NFClink establishment stage. For example, if Contacts sent by the peerdevice is received, when an identifier of a storage unit and an addressare queried, that both CO and Contacts must be met is used as a basis.

S1204. The NFCC sends a data acquiring instruction to the storage unitindicated by the determined identifier.

It should be noted that, if data in the storage unit is data only anddoes not include an instruction, the storage unit directly sends theoriginal data to the NFCC according to an instruction. If data in thestorage unit is data that includes a logical instruction, a to-be-sentdata packet is generated according to the logical instruction, and theto-be-sent data packet is sent to the NFCC.

S1205. The NFCC receives the data sent by the storage unit.

In this embodiment, the storage unit in the NFC module is alsopreferably an SE or a storage unit in the NFCC. The NFCC may acquiredata from one, two, or more storage units.

S1206. The NFCC sends the received data using the NFC link.

It should be noted that, if the received data is original data that isdirectly sent by the storage unit to the NFCC according to aninstruction, the NFCC converts the data into a data packet that meets anLLCP standard and sends the data packet using the NFC link. If thereceived data is a to-be-sent data packet generated according to alogical instruction, the NFCC directly sends the to-be-sent data packetusing the NFC link.

Returning to FIG. 11, S1102. After the NFC link is established, receivedata sent by a peer device and store the data in preset storage space inthe NFC module according to the type of the NFC link.

The preset storage space is determined by the NFC controller accordingto a received storage space application instruction that is sent by thecontroller of the electronic device after the LLCP link parameter isconfigured.

As shown in FIG. 13, the procedure of receiving data sent by a peerdevice and storing the data in preset storage space in the NFC moduleaccording to the type of the NFC link includes the following steps.

S1301. Establish the NFC link.

S1302. Determine the type of the NFC link.

S1303. Receive, according to the type of the NFC link, the data sent bythe peer device.

If the type of the NFC link is CO, an SAP of the data needs to bematched with that of the peer device, and then data is received. If thetype of the NFC link is CL or CL/CO, the data may be directly receivedwithout a matching procedure.

S1304. Query a storage space parameter of the storage space.

The storage space parameter is stored in a storage unit in the NFCmodule at a configuration stage. For the storage space parameter in thisembodiment, reference may be made to the foregoing Table 2.

S1305. Store the data in a corresponding storage unit in the NFC moduleaccording to the storage space parameter.

That is, according to the items in Table 2, the data is stored in astorage unit whose parameters match all the items. For example, ifreceived data is a photo and supports CL/CO, the data may be stored inSE3 whose address is Addr3.

It should be noted that, if an SAP that matches data is not found, thedata may be stored in storage space whose SAP is any type.

In the prior art, in an NFC data transmission procedure, a procedureinvolving application-layer data sending or receiving requiresparticipation of a DH. Therefore, when an electric quantity of anelectronic device is not enough to support the DH in working, an NFCmodule cannot transmit data.

According to the NFC data transmission method in this embodiment,because both to-be-transmitted data and a parameter of the data arestored in an NFC module in advance, or storage space for storingreceived data is set in an NFC module in advance, a DH is not requiredto participate in a data transmission procedure. Therefore, even if theDH cannot work due to a low electric quantity, when communicating with apeer NFC device, the NFC module can obtain electricity from an electricfield generated by means of radiation by the peer NFC device, andtherefore can transmit data in a case in which local electricity is notenough.

It can be seen that, according to the NFC data transmission method inthis embodiment, participation of a DH is not required, which can reduceload of the DH. In addition, a restriction by an electric quantity of anelectronic device is lifted, which brings convenience for a user.

Corresponding to the foregoing method embodiment, an embodiment of thepresent invention further discloses a control apparatus that is appliedto an electronic device and includes an NFC configuring moduleconfigured to, after a controller of the electronic device configures anLLCP link parameter, send preset data and a parameter of the data to anNFC module of the electronic device so that the NFC module stores thedata and the parameter of the data; and/or, after the controller of theelectronic device configures the LLCP link parameter, send a storagespace application instruction to the NFC module so that the NFC moduledetermines storage space for received data according to the instruction.

Further, the NFC configuring module may be a first NFC controllerinteraction unit configured to send the preset data to an NFC controllerin the NFC module so that the NFC controller sends the data to a storageunit in the NFC module for storage and send the parameter of the data tothe NFC controller so that the NFC controller stores the parameter ofthe data; or a first storage unit interaction unit configured to sendthe preset data to a storage unit in the NFC module so that the storageunit stores the data and sends a storage address of the data to thecontroller of the electronic device and send the received storageaddress fed back by the storage unit, an identifier of the storage unit,and the parameter of the data to an NFC controller so that the NFCcontroller stores the identifier of the storage unit, the storageaddress and the parameter of the data; or a second NFC controllerinteraction unit configured to send the storage space applicationinstruction that includes a storage space parameter to an NFC controllerin the NFC module so that the NFC controller applies to a storage unitin the NFC module for the storage space; or a second storage unitinteraction unit configured to send the storage space applicationinstruction that includes a space capacity to a storage unit in the NFCmodule so that the storage unit determines the storage spacecorresponding to the application instruction; receive an address of thedetermined storage space fed back by the storage unit; and send anidentifier of the storage unit, the storage address, and a storage spaceparameter to an NFC controller so that the NFC controller receives andstores the identifier of the storage unit, the storage address, and thestorage space parameter that are sent by the controller of theelectronic device.

In this embodiment, the storage unit is preferably an SE or a storageunit of an NFCC.

An embodiment of the present invention further discloses a controller.As shown in FIG. 14, the controller includes a first processor 1401configured to, after the controller of an electronic device configuresan LLCP link parameter, send preset data and a parameter of the data toan NFC module of the electronic device so that the NFC module stores thedata and the parameter of the data; and/or, after the controller of theelectronic device configures the LLCP link parameter, send a storagespace application instruction to the NFC module so that the NFC moduledetermines storage space for received data according to the instruction;and a first memory 1402 configured to store a program in the firstprocessor 1401 and data that is generated when the program in the firstprocessor 1401 runs.

An embodiment of the present invention further provides an NFC apparatusthat is applied to an electronic device and includes a configurationresponse module configured to receive and store preset data and aparameter of the data, where the preset data and the parameter of thedata are sent by a controller of the electronic device after an LLCPlink parameter is configured; and/or configured to receive a storagespace application instruction and determine storage space for receiveddata according to the instruction, where the storage space applicationinstruction is sent by the controller of the electronic device after theLLCP link parameter is configured.

Further, the configuration response module may include at least one ofthe following: a first NFC controller configured to receive the presetdata and the parameter of the data and send the data; and a firststorage unit configured to receive and store the data sent by the firstNFC controller and send a storage address of the data to the first NFCcontroller so that the first NFC controller stores an identifier of thestorage unit, the storage address, and the parameter of the data in afirst preset manner; or a second storage unit configured to receive andstore the preset data and send a storage address of the data to thecontroller of the electronic device so that the controller of theelectronic device sends the storage address of the data to a second NFCcontroller; and the second NFC controller configured to receive anidentifier of the storage unit, the storage address, and the parameterof the data that are sent by the controller of the electronic device andstore the identifier of the storage unit, the storage address, and theparameter of the data in a first preset manner; or a third NFCcontroller configured to receive the storage space applicationinstruction that includes a storage space parameter and send, accordingto the storage space application instruction, an application instructionthat includes a space capacity to a storage unit in the NFC module; anda third storage unit configured to determine storage space correspondingto the application instruction and send an address of the determinedstorage space to the third NFC controller so that the third NFCcontroller stores the address of the storage space, an identifier of thestorage unit, and the storage space parameter in a second preset manner;or a fourth storage unit configured to receive the storage spaceapplication instruction that includes a space capacity, determinestorage space corresponding to the application instruction, and send anaddress of the determined storage space to the controller of theelectronic device so that the controller of the electronic device sendsan identifier of the storage unit, the storage address, and a storagespace parameter to the NFC module; and a fourth NFC controllerconfigured to receive the identifier of the storage unit, the storageaddress, and the storage space parameter that are sent by the controllerof the electronic device and store the identifier of the storage unit,the storage address, and the storage space parameter in a second presetmanner.

An embodiment of the present invention further discloses an NFC controlapparatus that is applied to an NFC module of an electronic device. Asshown in FIG. 15, the apparatus includes at least one of the following:an NFC data sending module 1501 configured to, after an NFC link isestablished, acquire data from the NFC module according to a type of theNFC link and a parameter of the data and send the data using the NFClink, where the data and the parameter of the data are sent to the NFCmodule of the electronic device by a controller of the electronic deviceafter an LLCP link parameter is configured, and the data and theparameter of the data are stored by the NFC module; and an NFC datareceiving module 1502 configured to, after the NFC link is established,receive, according to the type of the NFC link, data sent by a peerdevice and store the data in preset storage space in the NFC module,where the preset storage space is determined by the NFC controlleraccording to a received storage space application instruction that issent by the controller of the electronic device after the LLCP linkparameter is configured.

Further, the NFC data sending module 1501 includes a first determiningunit configured to determine the type of the NFC link; a second queryingunit configured to query the parameter of the data and determine anidentifier of a storage unit in which the corresponding data thatsupports the type of the link is located; a sending unit configured tosend a data acquiring instruction to the storage unit indicated by thedetermined identifier; and a first receiving unit configured to receivethe data sent by the storage unit.

The NFC data receiving module 1502 includes a second determining unitconfigured to determine the type of the NFC link; a second receivingunit configured to receive, according to the type of the NFC link, thedata sent by the peer device; a second querying unit configured to querya storage space parameter of the storage space; and a storage unitconfigured to store the data in a corresponding storage unit in the NFCmodule according to the storage space parameter.

An embodiment of the present invention further discloses an NFCcontroller. As shown in FIG. 16, the NFC controller includes a secondprocessor 1601 configured to, after an NFC link is established, acquiredata from the NFC module according to a type of the NFC link and aparameter of the data and send the data using the NFC link, where thedata and the parameter of the data are sent to the NFC module of theelectronic device by a controller of the electronic device after an LLCPlink parameter is configured, and the data and the parameter of the dataare stored by the NFC module; and/or, after the NFC link is established,receive, according to the type of the NFC link, data sent by a peerdevice and store the data in preset storage space in the NFC module,where the preset storage space is determined by the NFC controlleraccording to a received storage space application instruction that issent by the controller of the electronic device after the LLCP linkparameter is configured; and a second memory 1602 configured to store aprogram in the second processor 1601 and data that is generated when theprogram in the second processor runs.

When the functions of the methods in the embodiments are implemented inthe form of a software functional unit and sold or used as anindependent product, the functions may be stored in a computingdevice—readable storage medium. Based on such an understanding, the partof the embodiments of the present invention contributing to the priorart or some of the technical solutions may be implemented in a form of asoftware product. The software product is stored in a storage medium andincludes several instructions for instructing a computing device (whichmay be a personal computer, a server, a mobile computing device, or anetwork device) to perform all or some of the steps of the methodsdescribed in the embodiments of the present invention. The foregoingstorage medium includes any medium that can store program code, such asa universal serial bus (USB) flash drive, a removable hard disk, aread-only memory (ROM), a random access memory (RAM), a magnetic disk,or an optical disc.

The embodiments in this specification are all described in a progressivemanner, for same or similar parts in the embodiments, reference may bemade to these embodiments, and each embodiment focuses on a differencefrom other embodiments.

The foregoing description of the disclosed embodiments enables a personskilled in the art to implement or use the present invention. Variousmodifications to the embodiments are obvious to the person skilled inthe art, and general principles defined in this specification may beimplemented in other embodiments without departing from the spirit orscope of the present invention. Therefore, the present invention willnot be limited to the embodiments described in this specification butextends to the widest scope that complies with the principles andnovelty disclosed in this specification.

What is claimed is:
 1. A near field communication (NFC) configurationmethod applied to a controller of an electronic device, after thecontroller of the electronic device configures a Logical Link ControlProtocol (LLCP) link parameter, the method comprising: sending presetdata and a parameter of the data to an NFC module of the electronicdevice such that the NFC module stores the data and the parameter of thedata, wherein sending the preset data and the parameter of the data tothe NFC module of the electronic device such that the NFC module storesthe data and the parameter of the data comprises: sending the presetdata to an NFC controller in the NFC module such that the NFC controllersends the data to a storage unit in the NFC module for storage; andsending the parameter of the data to the NFC controller such that theNFC controller stores the parameter of the data.
 2. The method accordingto claim 1, wherein the storage unit a security element in the NFCmodule.
 3. The method according to claim 1, wherein the storage unitcomprises a storage unit of the NFC controller in the NFC module.
 4. Anear field communication (NFC) data transmission method applied to anNFC controller in an NFC module of an electronic device, the methodcomprising: acquiring data, after an NFC link is established, from theNFC module according to a type of the NFC link and a parameter of thedata, and sending the data using the NFC link, wherein the data and theparameter of the data are sent to the NFC module of the electronicdevice by a controller of the electronic device after a Logical LinkControl Protocol (LLCP) link parameter is configured, and the data andthe parameter of the data are stored by the NFC module, and whereinacquiring the data from the NFC module according to the type of the NFClink and the parameter of the data comprises: determining the type ofthe NFC link; querying the parameter of the data and determining anidentifier of a storage unit in which the corresponding data thatsupports the type of the link is located; sending a data acquiringinstruction to the storage unit indicated by the determined identifier;and receiving the data sent by the storage unit.
 5. The method accordingto claim 4, wherein the storage unit comprises a security element in theNFC module.
 6. The method according to claim 4, wherein the storage unitcomprises a storage unit of the NFC controller in the NFC module.
 7. Acontrol apparatus applied to an electronic device, the control apparatuscomprising: a near field communication (NFC) configuring moduleconfigured to, after a controller of the electronic device configures aLogical Link Control Protocol (LLCP) link parameter, send preset dataand a parameter of the data to an NFC module of the electronic device,such that the NFC module stores the data and the parameter of the data,wherein the NFC configuring module comprises a first NFC controllerinteraction unit configured to send the data to an NFC controller in theNFC module such that the NFC controller sends the data to a storage unitin the NFC module for storage; and further configured to send theparameter of the data to the NFC controller such that the NFC controllerstores the parameter of the data.
 8. The controller according to claim7, wherein the storage unit comprises a security element in the NFCmodule.
 9. The controller according to claim 7, wherein the storage unitcomprises a storage unit of the NFC controller in the NFC module.